<!--#INCLUDE FILE="config.asp"-->

<%
if(Session("SalesAccessLevel") <> 1 and Session("SalesAccessLevel") <> 4 ) then
	Response.Redirect("default.asp")
end if

subject = request("subject")
arrival1 = request("arrival1")
callType = request("callType")
Notes = request("Notes")
prospectID_re = request("prospectID")

'encrypttitle = objEncrypter.Encrypt ( title )

		set objConnect = server.createObject("ADODB.Connection")       
		objConnect.open conStr

		Set oCmd = Server.CreateObject("ADODB.Command")

		oCmd.ActiveConnection = objConnect
		oCmd.CommandText = "sp_add_scheduleCall" 
		oCmd.CommandType = 4

		Set sh_subject = oCmd.CreateParameter("@subject", 200,1,100, subject)
		oCmd.Parameters.Append sh_subject
		
		Set sh_arrival1 = oCmd.CreateParameter("@date", 200,1,100, arrival1)
		oCmd.Parameters.Append sh_arrival1
		
		Set sh_note = oCmd.CreateParameter("@note", 200,1,100, Notes)
		oCmd.Parameters.Append sh_note
		
		Set sh_callType = oCmd.CreateParameter("@IsIncoming", 3,1,100, callType)
		oCmd.Parameters.Append sh_callType
					
		Set userId = oCmd.CreateParameter("@userId", 3,1,100,session("SalesId"))
		oCmd.Parameters.Append userId
		
		Set prospectId = oCmd.CreateParameter("@prospectId", 3,1,100,prospectID_re)
		oCmd.Parameters.Append prospectId

		set rss = oCmd.execute
		
		Response.Redirect("sales-dashboard.asp")
%>